
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html

# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.18)

# Declares and names the project.

project("canary")

# 需要引入我们头文件,以这个配置的目录为基准
#include_directories(src/main/jniLibs/include)

AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/src/main/cpp SRC_LIST)

add_library(
        # Sets the name of the library.
        canary
        # Sets the library as a shared library.
        SHARED
        # Provides a relative path to your source file(s).
        ${SRC_LIST}
        #        main/cpp/com_amon_canary.cpp
        src/main/cpp/xhook/xh_core.c
        src/main/cpp/xhook/xh_elf.c
        src/main/cpp/xhook/xh_jni.c
        src/main/cpp/xhook/xh_log.c
        src/main/cpp/xhook/xh_util.c
        src/main/cpp/xhook/xh_version.c
        src/main/cpp/xhook/xhook.c
)

target_link_libraries( # Specifies the target library.
        canary
        # 链接 android ndk 自带的一些库
        android
        log)
